//- Copyright (c) 2016 Lucky Byte, Inc.
extends trstat

append form_items
  .field.two.wide
    .ui.labeled.dropdown.selection.input.status
      input(type="hidden" name="succed" value="#{succed || 'none'}")
      i.icon.dropdown
      .default.text 所有交易
      .menu
        .item(data-value="none") 所有交易
        .item(data-value="true") 成功交易
        .item(data-value="false") 失败交易

  .field.seven.wide
    .ui.buttons.right.floated.small.compact
      button.ui.green.button.labeled.icon(type="submit") 查 询
        i.icon.search

block thead
  tr
    th.collapsing.center.aligned 序号
    th.center.aligned 交易渠道
    th.center.aligned 商户编号
    th.center.aligned 交易笔数
    th.center.aligned 交易金额
    th.center.aligned 手续费
    th.center.aligned 商户名称
    th.center.aligned 联系地址
    th.center.aligned 联系人
    th.center.aligned 联系电话

block tbody
  each record, index in records
    tr
      td.collapsing.center.aligned= index + 1
      td.center.aligned #{record.chnl}-#{constant.merch_chnls[record.chnl]}
      td.center.aligned= record.merno
      td.center.aligned
        a.link.trlist(href="#"
          data-keyword="#{record.merno || ''}"
          data-chnl="#{record.chnl || ''}"
          data-incoming="false"
          data-settl="true"
          data-succed="#{succed || ''}")
          = record.total_cnt || 0
      td.center.aligned ¥ #{fmtamt(record.total_amt)}
      td.center.aligned ¥ #{record.total_fee}
      td.center.aligned= record.merch.name
      td.center.aligned= record.merch.address
      td.center.aligned= record.merch.contact
      td.center.aligned= record.merch.mobile
  else
      td.center.aligned.warning(colspan="10") 无数据
